﻿@section PageTitle { Image Layer }

<p class="summary">Image Layers accept input from a variety of sources, and it is also straightforward to write 
	your own <code>ImageSource</code>. The image sources included with DynamicImage let you load images from:</p>

<table class="table table-bordered">
	<tr>
		<td>Raw bytes</td>
		<td><code>BytesImageSource</code></td>
	</tr>
	<tr>
		<td>Binary database field</td>
		<td><code>SqlDatabaseImageSource</code></td>
	</tr>
	<tr>
		<td>File</td>
		<td><code>FileImageSource</code></td>
	</tr>
	<tr>
		<td>Bitmap</td>
		<td><code>ImageImageSource</code></td>
	</tr>
	<tr>
		<td>Remote URL</td>
		<td><code>RemoteImageSource</code></td>
	</tr>
</table>

<pre class="prettyprint">
@@Html.DynamicImageTag(b => b.WithLayer(
	LayerBuilder.Image.SourceFile("~/Assets/Images/Tulips.jpg")
		.WithFilter(FilterBuilder.Resize.ToWidth(500))))
</pre>

<p>
	@Html.DynamicImageTag(b => b.WithLayer(LayerBuilder.Image.SourceFile("~/Assets/Images/Tulips.jpg").WithFilter(
		FilterBuilder.Resize.ToWidth(500))))
</p>

<pre class="prettyprint">
@@Html.DynamicImageTag(b => b.WithLayer(
	LayerBuilder.Image.SourceUrl("http://www.google.com/images/srpr/logo4w.png")
		.WithFilter(FilterBuilder.Resize.ToWidth(500))))
</pre>

<p>
	@Html.DynamicImageTag(b => b.WithLayer(
		LayerBuilder.Image.SourceUrl("http://www.google.com/images/srpr/logo4w.png")
			.WithFilter(FilterBuilder.Resize.ToWidth(500))))
</p>